package com.bootdo.system.controller;

import com.bootdo.common.utils.R;
import com.bootdo.system.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 况鑫威
 * @Date: 2021/6/4
 * @Time: 11:22
 * @ClassName: StatisticsController
 * @Description: com.bootdo.system.controller
 */
@Controller
@RequestMapping("/statistics")
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;

    @ResponseBody
    @GetMapping("/getStatistics")
    public R getStatistics(){
        return R.ok(statisticsService.statistics());
    }

    @GetMapping
    public String statistics(){
        return "system/statistics/statistics";
    }
}
